package com.example.demo.domain.exam;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.demo.annotation.Display;
import com.example.demo.enums.FileType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.RequiredArgsConstructor;

@Data
@RequiredArgsConstructor
@TableName(value = "com_path")
public class FilePath {


    @Display("标识")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Display("用户标识")
    @TableField(value = "user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @Display("文件地址")
    @TableField(value = "url")
    private String url;

    @Display("文件名称")
    @TableField(value = "name")
    private String name;

    @Display("文件大小")
    @TableField(value = "size")
    private Long size;

    @Display("考试名称")
    @TableField(value = "type")
    private FileType type;

    @Display("考试标识")
    @TableField(value = "exam_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examId;

}
